package com.example.movie.adapter

import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.movie.view.MovieListFragment

class MovieViewPagerAdapter constructor(private val fragments: MutableList<MovieListFragment>, fm: FragmentManager, lifecycle: Lifecycle): FragmentStateAdapter(fm, lifecycle) {
    override fun getItemCount(): Int = fragments.size

    override fun createFragment(position: Int): MovieListFragment = fragments[position]

    override fun getItemId(position: Int): Long = position.toLong()
}